wayland: do not cancel key repeat on key press
authorOlivier Fourdan <ofourdan@redhat.com>
Thu, 2 Feb 2017 09:43:45 +0000 (10:43 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Mon, 27 Feb 2017 10:53:03 +0000 (11:53 +0100)
commit4c533e17f54e6685162eb4c43077ccc36b87dda0
tree372a26047f60d2c7457a2890f6b35b1fba581495
parentdf65db2ad0cdeeff8c98e8d55ff2f83825bfb210
wayland: do not cancel key repeat on key press

The key repeat is stopped as soon as a key is pressed, so if the user
quickly presses a key while another is already pressed and being
repeated, key repeat gets cancelled:

 - key1 press
 - key1 repeat
 - key2 press -> key1 repeat stopped
 - key1 release
 - key 2 is not repeated even though it's kept depressed

This is a different behavior from X11, which confuses migrating users.

To mimic the X11 behavior, keep track of the number of keys pressed
simultaneously and cancel key repeat only when none is pressed.

This way, if a user pressed a key while another one is being repeated,
the new key press can possibly be repeated as well.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=778019
gdk/wayland/gdkdevice-wayland.c